﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;

namespace TSVNAddin.Core
{
	public class ProjectItemAdapter : ISolutionExplorerItem
	{
		private readonly ProjectItem _ProjectItem;

		public ProjectItemAdapter(ProjectItem projectItem)
		{
			_ProjectItem = projectItem;
		}

		ISolutionExplorerItem ISolutionExplorerItem.GetChildByName(string name)
		{
			foreach (ProjectItem item in _ProjectItem.ProjectItems)
			{
				if (item.Name == name)
					return new ProjectItemAdapter(item);
			}

			return null;
		}

		string ISolutionExplorerItem.GetPath()
		{
			return _ProjectItem.get_FileNames(0);
		}
	}
}
